home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / emacs-complete / fsf / emacs / info / emacs-9 (.txt) < prev    next >
GNU Info File  |  1994-10-05  |  50KB  |  898 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Auto Fill,  Next: Fill Commands,  Up: Filling
  4. Auto Fill Mode
  5. --------------
  6.    "Auto Fill" mode is a minor mode in which lines are broken
  7. automatically when they become too wide.  Breaking happens only when
  8. you type a SPC or RET.
  9. `M-x auto-fill-mode'
  10.      Enable or disable Auto Fill mode.
  11. `SPC'
  12. `RET'
  13.      In Auto Fill mode, break lines when appropriate.
  14.    `M-x auto-fill-mode' turns Auto Fill mode on if it was off, or off
  15. if it was on.  With a positive numeric argument it always turns Auto
  16. Fill mode on, and with a negative argument always turns it off.  You can
  17. see when Auto Fill mode is in effect by the presence of the word `Fill'
  18. in the mode line, inside the parentheses.  Auto Fill mode is a minor
  19. mode which is enabled or disabled for each buffer individually.  *Note
  20. Minor Modes::.
  21.    In Auto Fill mode, lines are broken automatically at spaces when
  22. they get longer than the desired width.  Line breaking and
  23. rearrangement takes place only when you type SPC or RET.  If you wish
  24. to insert a space or newline without permitting line-breaking, type
  25. `C-q SPC' or `C-q LFD' (recall that a newline is really a linefeed).
  26. Also, `C-o' inserts a newline without line breaking.
  27.    Auto Fill mode works well with Lisp mode, because when it makes a new
  28. line in Lisp mode it indents that line with TAB.  If a line ending in a
  29. comment gets too long, the text of the comment is split into two
  30. comment lines.  Optionally new comment delimiters are inserted at the
  31. end of the first line and the beginning of the second so that each line
  32. is a separate comment; the variable `comment-multi-line' controls the
  33. choice (*note Comments::.).
  34.    Auto Fill mode does not refill entire paragraphs; it can break lines
  35. but cannot merge lines.  So editing in the middle of a paragraph can
  36. result in a paragraph that is not correctly filled.  The easiest way to
  37. make the paragraph properly filled again is usually with the explicit
  38. fill commands.  *Note Fill Commands::.
  39.    Many users like Auto Fill mode and want to use it in all text files.
  40. The section on init files says how to arrange this permanently for
  41. yourself.  *Note Init File::.
  42. File: emacs,  Node: Fill Commands,  Next: Fill Prefix,  Prev: Auto Fill,  Up: Filling
  43. Explicit Fill Commands
  44. ----------------------
  45. `M-q'
  46.      Fill current paragraph (`fill-paragraph').
  47. `C-x f'
  48.      Set the fill column (`set-fill-column').
  49. `M-x fill-region'
  50.      Fill each paragraph in the region (`fill-region').
  51. `M-x fill-region-as-paragraph.'
  52.      Fill the region, considering it as one paragraph.
  53. `M-s'
  54.      Center a line.
  55.    To refill a paragraph, use the command `M-q' (`fill-paragraph').
  56. This operates on the paragraph that point is inside, or the one after
  57. point if point is between paragraphs.  Refilling works by removing all
  58. the line-breaks, then inserting new ones where necessary.
  59.    To refill many paragraphs, use `M-x fill-region', which divides the
  60. region into paragraphs and fills each of them.
  61.    `M-q' and `fill-region' use the same criteria as `M-h' for finding
  62. paragraph boundaries (*note Paragraphs::.).  For more control, you can
  63. use `M-x fill-region-as-paragraph', which refills everything between
  64. point and mark.  This command deletes any blank lines within the
  65. region, so separate blocks of text end up combined into one block.
  66.    A numeric argument to `M-q' causes it to "justify" the text as well
  67. as filling it.  This means that extra spaces are inserted to make the
  68. right margin line up exactly at the fill column.  To remove the extra
  69. spaces, use `M-q' with no argument.  (Likewise for `fill-region'.)
  70.    When `adaptive-fill-mode' is non-`nil' (which is normally the case),
  71. if you use `fill-region-as-paragraph' on an indented paragraph and you
  72. don't have a fill prefix, it uses the indentation of the second line of
  73. the paragraph as the fill prefix.  The effect of adaptive filling is
  74. not noticeable in Text mode, because an indented line counts as a
  75. paragraph starter and thus each line of an indented paragraph is
  76. considered a paragraph of its own.  But you do notice the effect in
  77. Indented Text mode and some other major modes.
  78.    The command `M-s' (`center-line') centers the current line within
  79. the current fill column.  With an argument N, it centers N lines
  80. individually and moves past them.
  81.    The maximum line width for filling is in the variable `fill-column'.
  82. Altering the value of `fill-column' makes it local to the current
  83. buffer; until that time, the default value is in effect.  The default
  84. is initially 70.  *Note Locals::.  The easiest way to set `fill-column'
  85. is to use the command `C-x f' (`set-fill-column').  With no argument,
  86. it sets `fill-column' to the current horizontal position of point.
  87. With a numeric argument, it uses that as the new fill column.
  88.    Emacs commands normally consider a period followed by two spaces or
  89. by a newline as the end of a sentence; a period followed by just one
  90. space indicates an abbreviation and not the end of a sentence.  To
  91. preserve the distinction between these two ways of using a period, the
  92. fill commands do not break a line after a period followed by just one
  93. space.
  94.    If the variable `sentence-end-double-space' is `nil', the fill
  95. commands expect and leave just one space at the end of a sentence.
  96. Ordinarily this variable is `t', so the fill commands insist on two
  97. spaces for the end of a sentence, as explained above.  *Note
  98. Sentences::.
  99. File: emacs,  Node: Fill Prefix,  Prev: Fill Commands,  Up: Filling
  100. The Fill Prefix
  101. ---------------
  102.    To fill a paragraph in which each line starts with a special marker
  103. (which might be a few spaces, giving an indented paragraph), use the
  104. "fill prefix" feature.  The fill prefix is a string which Emacs expects
  105. every line to start with, and which is not included in filling.
  106. `C-x .'
  107.      Set the fill prefix (`set-fill-prefix').
  108. `M-q'
  109.      Fill a paragraph using current fill prefix (`fill-paragraph').
  110. `M-x fill-individual-paragraphs'
  111.      Fill the region, considering each change of indentation as
  112.      starting a new paragraph.
  113. `M-x fill-nonuniform-paragraphs'
  114.      Fill the region, considering only paragraph-separator lines as
  115.      starting a new paragraph.
  116.    To specify a fill prefix, move to a line that starts with the desired
  117. prefix, put point at the end of the prefix, and give the command
  118. `C-x .' (`set-fill-prefix').  That's a period after the `C-x'.  To turn
  119. off the fill prefix, specify an empty prefix: type `C-x .' with point
  120. at the beginning of a line.
  121.    When a fill prefix is in effect, the fill commands remove the fill
  122. prefix from each line before filling and insert it on each line after
  123. filling.  Auto Fill mode also inserts the fill prefix automatically when
  124. it makes a new line.  The `C-o' command inserts the fill prefix on new
  125. lines it creates, when you use it at the beginning of a line (*note
  126. Blank Lines::.).  Conversely, the command `M-^' deletes the prefix (if
  127. it occurs) after the newline that it deletes (*note Indentation::.).
  128.    For example, if `fill-column' is 40 and you set the fill prefix to
  129. `;; ', then `M-q' in the following text
  130.      ;; This is an
  131.      ;; example of a paragraph
  132.      ;; inside a Lisp-style comment.
  133. produces this:
  134.      ;; This is an example of a paragraph
  135.      ;; inside a Lisp-style comment.
  136.    Lines that do not start with the fill prefix are considered to start
  137. paragraphs, both in `M-q' and the paragraph commands; this is gives
  138. good results for paragraphs with hanging indentation (every line
  139. indented except the first one).  Lines which are blank or indented once
  140. the prefix is removed also separate or start paragraphs; this is what
  141. you want if you are writing multi-paragraph comments with a comment
  142. delimiter on each line.
  143.    You can use `M-x fill-individual-paragraphs' to set the fill prefix
  144. for each paragraph automatically.  This command divides the region into
  145. paragraphs, treating every change in the amount of indentation as the
  146. start of a new paragraph, and fills each of these paragraphs.  Thus,
  147. all the lines in one "paragraph" have the same amount of indentation.
  148. That indentation serves as the fill prefix for that paragraph.
  149.    `M-x fill-nonuniform-paragraphs' is a similar command that divides
  150. the region into paragraphs in a different way.  It considers only
  151. paragraph-separating lines (as defined by `paragraph-separate') as
  152. starting a new paragraph.  Since this means that the lines of one
  153. paragraph may have different amounts of indentation, the fill prefix
  154. used is the smallest amount of indentation of any of the lines of the
  155. paragraph.  This gives good results with styles that indent a
  156. paragraph's first line more or less that the rest of the paragraph.
  157.    The fill prefix is stored in the variable `fill-prefix'.  Its value
  158. is a string, or `nil' when there is no fill prefix.  This is a
  159. per-buffer variable; altering the variable affects only the current
  160. buffer, but there is a default value which you can change as well.
  161. *Note Locals::.
  162. File: emacs,  Node: Case,  Next: Text Mode,  Prev: Filling,  Up: Text
  163. Case Conversion Commands
  164. ========================
  165.    Emacs has commands for converting either a single word or any
  166. arbitrary range of text to upper case or to lower case.
  167. `M-l'
  168.      Convert following word to lower case (`downcase-word').
  169. `M-u'
  170.      Convert following word to upper case (`upcase-word').
  171. `M-c'
  172.      Capitalize the following word (`capitalize-word').
  173. `C-x C-l'
  174.      Convert region to lower case (`downcase-region').
  175. `C-x C-u'
  176.      Convert region to upper case (`upcase-region').
  177.    The word conversion commands are the most useful.  `M-l'
  178. (`downcase-word') converts the word after point to lower case, moving
  179. past it.  Thus, repeating `M-l' converts successive words.  `M-u'
  180. (`upcase-word') converts to all capitals instead, while `M-c'
  181. (`capitalize-word') puts the first letter of the word into upper case
  182. and the rest into lower case.  All these commands convert several words
  183. at once if given an argument.  They are especially convenient for
  184. converting a large amount of text from all upper case to mixed case,
  185. because you can move through the text using `M-l', `M-u' or `M-c' on
  186. each word as appropriate, occasionally using `M-f' instead to skip a
  187. word.
  188.    When given a negative argument, the word case conversion commands
  189. apply to the appropriate number of words before point, but do not move
  190. point.  This is convenient when you have just typed a word in the wrong
  191. case: you can give the case conversion command and continue typing.
  192.    If a word case conversion command is given in the middle of a word,
  193. it applies only to the part of the word which follows point.  This is
  194. just like what `M-d' (`kill-word') does.  With a negative argument,
  195. case conversion applies only to the part of the word before point.
  196.    The other case conversion commands are `C-x C-u' (`upcase-region')
  197. and `C-x C-l' (`downcase-region'), which convert everything between
  198. point and mark to the specified case.  Point and mark do not move.
  199.    The region case conversion commands `upcase-region' and
  200. `downcase-region' are normally disabled.  This means that they ask for
  201. confirmation if you try to use them.  When you confirm, you may enable
  202. the command, which means it will not ask for confirmation again.  *Note
  203. Disabling::.
  204. File: emacs,  Node: Text Mode,  Next: Outline Mode,  Prev: Case,  Up: Text
  205. Text Mode
  206. =========
  207.    When you edit files of text in a human language, it's more convenient
  208. to use Text mode rather than Fundamental mode.  Invoke `M-x text-mode'
  209. to enter Text mode.  In Text mode, TAB runs the function
  210. `tab-to-tab-stop', which allows you to use arbitrary tab stops set with
  211. `M-x edit-tab-stops' (*note Tab Stops::.).  Features concerned with
  212. comments in programs are turned off in Text mode except when explicitly
  213. invoked.  The syntax table is changed so that periods are not
  214. considered part of a word, while apostrophes, backspaces and underlines
  215. are part of words.
  216.    A similar variant mode is Indented Text mode, intended for editing
  217. text in which most lines are indented.  This mode defines TAB to run
  218. `indent-relative' (*note Indentation::.), and makes Auto Fill indent
  219. the lines it creates.  The result is that normally a line made by Auto
  220. Filling, or by LFD, is indented just like the previous line.  In
  221. Indented Text mode, only blank lines separate paragraphs--indented
  222. lines continue the current paragraph.  Use `M-x indented-text-mode' to
  223. select this mode.
  224.    Text mode, and all the modes based on it, define `M-TAB' as the
  225. command `ispell-complete-word', which performs completion of the
  226. partial word in the buffer before point, using the spelling dictionary
  227. as the space of possible words.  *Note Spelling::.
  228.    Entering Text mode or Indented Text mode runs the hook
  229. `text-mode-hook'.  Other major modes related to Text mode also run this
  230. hook, followed by hooks of their own; this includes Nroff mode, TeX
  231. mode, Outline mode and Mail mode.  Hook functions on `text-mode-hook'
  232. can look at the value of `major-mode' to see which of these modes is
  233. actually being entered.  *Note Hooks::.
  234. * Menu:
  235.   Emacs provides two other modes for editing text that is to be passed
  236. through a text formatter to produce fancy formatted printed output.
  237. * Nroff Mode::      The major mode for editing input to the formatter nroff.
  238. * TeX Mode::      The major modes for editing input to the formatter TeX.
  239.   Another mode is used for editing outlines.  It allows you to view the
  240. text at various levels of detail.  You can view either the outline
  241. headings alone or both headings and text; you can also hide some of the
  242. headings at lower levels from view to make the high level structure more
  243. visible.
  244. * Outline Mode::  The major mode for editing outlines.
  245. File: emacs,  Node: Outline Mode,  Next: TeX Mode,  Prev: Text Mode,  Up: Text
  246. Outline Mode
  247. ============
  248.    Outline mode is a major mode much like Text mode but intended for
  249. editing outlines.  It allows you to make parts of the text temporarily
  250. invisible so that you can see the outline structure.  Type `M-x
  251. outline-mode' to switch to Outline mode as the major mode of the current
  252. buffer.  Type `M-x outline-minor-mode' to enable Outline mode as a
  253. minor mode in the current buffer.  Outline minor mode provides the same
  254. commands as the major mode, Outline mode, but you can use it in
  255. conjunction with other major modes.
  256.    The major mode, Outline mode, provides special key bindings on the
  257. `C-c' prefix.  Outline minor mode provides similar bindings with `C-c
  258. C-o' as the prefix; this is to reduce the conflicts with the major
  259. mode's special commands.  (The variable `outline-minor-mode-prefix'
  260. controls the prefix used.)
  261.    When Outline mode makes a line invisible, the line does not appear on
  262. the screen.  The screen appears exactly as if the invisible line were
  263. deleted, except that an ellipsis (three periods in a row) appears at the
  264. end of the previous visible line (only one ellipsis no matter how many
  265. invisible lines follow).
  266.    All editing commands treat the text of the invisible line as part of
  267. the previous visible line.  For example, `C-n' moves onto the next
  268. visible line.  Killing an entire visible line, including its
  269. terminating newline, really kills all the following invisible lines
  270. along with it; yanking it all back yanks the invisible lines and they
  271. remain invisible.
  272.    Entering Outline mode runs the hook `text-mode-hook' followed by the
  273. hook `outline-mode-hook' (*note Hooks::.).
  274. * Menu:
  275. * Format: Outline Format.       What the text of an outline looks like.
  276. * Motion: Outline Motion.       Special commands for moving through
  277.                                      outlines.
  278. * Visibility: Outline Visibility.  Commands to control what is visible.
  279. File: emacs,  Node: Outline Format,  Next: Outline Motion,  Up: Outline Mode
  280. Format of Outlines
  281. ------------------
  282.    Outline mode assumes that the lines in the buffer are of two types:
  283. "heading lines" and "body lines".  A heading line represents a topic in
  284. the outline.  Heading lines start with one or more stars; the number of
  285. stars determines the depth of the heading in the outline structure.
  286. Thus, a heading line with one star is a major topic; all the heading
  287. lines with two stars between it and the next one-star heading are its
  288. subtopics; and so on.  Any line that is not a heading line is a body
  289. line.  Body lines belong with the preceding heading line.  Here is an
  290. example:
  291.      * Food
  292.      
  293.      This is the body,
  294.      which says something about the topic of food.
  295.      
  296.      ** Delicious Food
  297.      
  298.      This is the body of the second-level header.
  299.      
  300.      ** Distasteful Food
  301.      
  302.      This could have
  303.      a body too, with
  304.      several lines.
  305.      
  306.      *** Dormitory Food
  307.      
  308.      * Shelter
  309.      
  310.      Another first-level topic with its header line.
  311.    A heading line together with all following body lines is called
  312. collectively an "entry".  A heading line together with all following
  313. deeper heading lines and their body lines is called a "subtree".
  314.    You can customize the criterion for distinguishing heading lines by
  315. setting the variable `outline-regexp'.  Any line whose beginning has a
  316. match for this regexp is considered a heading line.  Matches that start
  317. within a line (not at the left margin) do not count.  The length of the
  318. matching text determines the level of the heading; longer matches make
  319. a more deeply nested level.  Thus, for example, if a text formatter has
  320. commands `@chapter', `@section' and `@subsection' to divide the
  321. document into chapters and sections, you could make those lines count
  322. as heading lines by setting `outline-regexp' to
  323. `"@chap\\|@\\(sub\\)*section"'.  Note the trick: the two words
  324. `chapter' and `section' are equally long, but by defining the regexp to
  325. match only `chap' we ensure that the length of the text matched on a
  326. chapter heading is shorter, so that Outline mode will know that
  327. sections are contained in chapters.  This works as long as no other
  328. command starts with `@chap'.
  329.    It is possible to change the rule for calculating the level of a
  330. heading line by setting the variable `outline-level'.  The value of
  331. `outline-level' should be a function that takes no arguments and
  332. returns the level of the current heading.  Some major modes such as C,
  333. Nroff, and Emacs Lisp mode set this variable in order to work with
  334. Outline minor mode.
  335.    Outline mode makes a line invisible by changing the newline before it
  336. into an ASCII control-M (code 015).  Most editing commands that work on
  337. lines treat an invisible line as part of the previous line because,
  338. strictly speaking, it *is* part of that line, since there is no longer a
  339. newline in between.  When you save the file in Outline mode, control-M
  340. characters are saved as newlines, so the invisible lines become ordinary
  341. lines in the file.  But saving does not change the visibility status of
  342. a line inside Emacs.
  343. File: emacs,  Node: Outline Motion,  Next: Outline Visibility,  Prev: Outline Format,  Up: Outline Mode
  344. Outline Motion Commands
  345. -----------------------
  346.    There are some special motion commands in Outline mode that move
  347. backward and forward to heading lines.
  348. `C-c C-n'
  349.      Move point to the next visible heading line
  350.      (`outline-next-visible-heading').
  351. `C-c C-p'
  352.      Move point to the previous visible heading line
  353.      (`outline-previous-visible-heading').
  354. `C-c C-f'
  355.      Move point to the next visible heading line at the same level as
  356.      the one point is on (`outline-forward-same-level').
  357. `C-c C-b'
  358.      Move point to the previous visible heading line at the same level
  359.      (`outline-backward-same-level').
  360. `C-c C-u'
  361.      Move point up to a lower-level (more inclusive) visible heading
  362.      line (`outline-up-heading').
  363.    `C-c C-n' (`next-visible-heading') moves down to the next heading
  364. line.  `C-c C-p' (`previous-visible-heading') moves similarly backward.
  365. Both accept numeric arguments as repeat counts.  The names emphasize
  366. that invisible headings are skipped, but this is not really a special
  367. feature.  All editing commands that look for lines ignore the invisible
  368. lines automatically.
  369.    More powerful motion commands understand the level structure of
  370. headings.  `C-c C-f' (`outline-forward-same-level') and `C-c C-b'
  371. (`outline-backward-same-level') move from one heading line to another
  372. visible heading at the same depth in the outline.  `C-c C-u'
  373. (`outline-up-heading') moves backward to another heading that is less
  374. deeply nested.
  375. File: emacs,  Node: Outline Visibility,  Prev: Outline Motion,  Up: Outline Mode
  376. Outline Visibility Commands
  377. ---------------------------
  378.    The other special commands of outline mode are used to make lines
  379. visible or invisible.  Their names all start with `hide' or `show'.
  380. Most of them fall into pairs of opposites.  They are not undoable;
  381. instead, you can undo right past them.  Making lines visible or
  382. invisible is simply not recorded by the undo mechanism.
  383. `C-c C-t'
  384.      Make all body lines in the buffer invisible (`hide-body').
  385. `C-c C-a'
  386.      Make all lines in the buffer visible (`show-all').
  387. `C-c C-d'
  388.      Make everything under this heading invisible, not including this
  389.      heading itself
  390.      (`hide-subtree').
  391. `C-c C-s'
  392.      Make everything under this heading visible, including body,
  393.      subheadings, and their bodies (`show-subtree').
  394. `C-c C-l'
  395.      Make the body of this heading line, and of all its subheadings,
  396.      invisible (`hide-leaves').
  397. `C-c C-k'
  398.      Make all subheadings of this heading line, at all levels, visible
  399.      (`show-branches').
  400. `C-c C-i'
  401.      Make immediate subheadings (one level down) of this heading line
  402.      visible (`show-children').
  403. `C-c C-c'
  404.      Make this heading line's body invisible (`hide-entry').
  405. `C-c C-e'
  406.      Make this heading line's body visible (`show-entry').
  407. `C-c C-q'
  408.      Hide everything except the top N levels of heading lines
  409.      (`hide-sublevels').
  410. `C-c C-o'
  411.      Hide everything except for the heading or body that point is in,
  412.      plus the headings leading up from there to the top level of the
  413.      outline (`hide-other').
  414.    Two commands that are exact opposites are `C-c C-c' (`hide-entry')
  415. and `C-c C-e' (`show-entry').  They are used with point on a heading
  416. line, and apply only to the body lines of that heading.  Subheadings
  417. and their bodies are not affected.
  418.    Two more powerful opposites are `C-c C-d' (`hide-subtree') and `C-c
  419. C-s' (`show-subtree').  Both expect to be used when point is on a
  420. heading line, and both apply to all the lines of that heading's
  421. "subtree": its body, all its subheadings, both direct and indirect, and
  422. all of their bodies.  In other words, the subtree contains everything
  423. following this heading line, up to and not including the next heading of
  424. the same or higher rank.
  425.    Intermediate between a visible subtree and an invisible one is having
  426. all the subheadings visible but none of the body.  There are two
  427. commands for doing this, depending on whether you want to hide the
  428. bodies or make the subheadings visible.  They are `C-c C-l'
  429. (`hide-leaves') and `C-c C-k' (`show-branches').
  430.    A little weaker than `show-branches' is `C-c C-i' (`show-children').
  431. It makes just the direct subheadings visible--those one level down.
  432. Deeper subheadings remain invisible, if they were invisible.
  433.    Two commands have a blanket effect on the whole file.  `C-c C-t'
  434. (`hide-body') makes all body lines invisible, so that you see just the
  435. outline structure.  `C-c C-a' (`show-all') makes all lines visible.
  436. These commands can be thought of as a pair of opposites even though
  437. `C-c C-a' applies to more than just body lines.
  438.    The command `C-c C-q' (`hide-sublevels') hides all but the top level
  439. headings.  With a numeric argument N, it hides everything except the
  440. top N levels of heading lines.
  441.    The command `C-c C-o' (`hide-other') hides everything except the
  442. heading or body text that point is in, plus its parents (the headers
  443. leading up from there to top level in the outline).
  444.    You can turn off the use of ellipses at the ends of visible lines by
  445. setting `selective-display-ellipses' to `nil'.  Then there is no
  446. visible indication of the presence of invisible lines.
  447. File: emacs,  Node: TeX Mode,  Next: Nroff Mode,  Prev: Outline Mode,  Up: Text
  448. TeX Mode
  449. ========
  450.    TeX is a powerful text formatter written by Donald Knuth; it is also
  451. free, like GNU Emacs.  LaTeX is a simplified input format for TeX,
  452. implemented by TeX macros; it comes with TeX.  SliTeX is a special form
  453. of LaTeX.
  454.    Emacs has a special TeX mode for editing TeX input files.  It
  455. provides facilities for checking the balance of delimiters and for
  456. invoking TeX on all or part of the file.
  457.    TeX mode has three variants, Plain TeX mode, LaTeX mode, and SliTeX
  458. mode (these three distinct major modes differ only slightly).  They are
  459. designed for editing the three different formats.  The command `M-x
  460. tex-mode' looks at the contents of the buffer to determine whether the
  461. contents appear to be either LaTeX input or SliTeX input; if so, it
  462. selects the appropriate mode.  If the file contents do not appear to be
  463. LaTeX or SliTeX, it selects Plain TeX mode.  If the contents are
  464. insufficient to determine this, the variable `tex-default-mode'
  465. controls which mode is used.
  466.    When `M-x tex-mode' does not guess right, you can use the commands
  467. `M-x plain-tex-mode', `M-x latex-mode', and `M-x slitex-mode' to select
  468. explicitly the particular variants of TeX mode.
  469. * Menu:
  470. * Editing: TeX Editing.   Special commands for editing in TeX mode.
  471. * LaTeX: LaTeX Editing.   Additional commands for LaTeX input files.
  472. * Printing: TeX Print.    Commands for printing part of a file with TeX.
  473. * Getting: TeX Distrib.   Getting the latest Unix TeX distribution.
  474. File: emacs,  Node: TeX Editing,  Next: LaTeX Editing,  Up: TeX Mode
  475. TeX Editing Commands
  476. --------------------
  477.    Here are the special commands provided in TeX mode for editing the
  478. text of the file.
  479.      Insert, according to context, either ```' or `"' or `'''
  480.      (`tex-insert-quote').
  481. `LFD'
  482.      Insert a paragraph break (two newlines) and check the previous
  483.      paragraph for unbalanced braces or dollar signs
  484.      (`tex-terminate-paragraph').
  485. `M-x validate-tex-region'
  486.      Check each paragraph in the region for unbalanced braces or dollar
  487.      signs.
  488. `C-c {'
  489.      Insert `{}' and position point between them (`tex-insert-braces').
  490. `C-c }'
  491.      Move forward past the next unmatched close brace (`up-list').
  492.    In TeX, the character `"' is not normally used; we use ```' to start
  493. a quotation and `''' to end one.  To make editing easier under this
  494. formatting convention, TeX mode overrides the normal meaning of the key
  495. `"' with a command that inserts a pair of single-quotes or backquotes
  496. (`tex-insert-quote').  To be precise, this command inserts ```' after
  497. whitespace or an open brace, `"' after a backslash, and `''' after any
  498. other character.
  499.    If you need the character `"' itself in unusual contexts, use `C-q'
  500. to insert it.  Also, `"' with a numeric argument always inserts that
  501. number of `"' characters.
  502.    In TeX mode, `$' has a special syntax code which attempts to
  503. understand the way TeX math mode delimiters match.  When you insert a
  504. `$' that is meant to exit math mode, the position of the matching `$'
  505. that entered math mode is displayed for a second.  This is the same
  506. feature that displays the open brace that matches a close brace that is
  507. inserted.  However, there is no way to tell whether a `$' enters math
  508. mode or leaves it; so when you insert a `$' that enters math mode, the
  509. previous `$' position is shown as if it were a match, even though they
  510. are actually unrelated.
  511.    TeX uses braces as delimiters that must match.  Some users prefer to
  512. keep braces balanced at all times, rather than inserting them singly.
  513. Use `C-c {' (`tex-insert-braces') to insert a pair of braces.  It
  514. leaves point between the two braces so you can insert the text that
  515. belongs inside.  Afterward, use the command `C-c }' (`up-list') to move
  516. forward past the close brace.
  517.    There are two commands for checking the matching of braces.  LFD
  518. (`tex-terminate-paragraph') checks the paragraph before point, and
  519. inserts two newlines to start a new paragraph.  It prints a message in
  520. the echo area if any mismatch is found.  `M-x validate-tex-region'
  521. checks a region, paragraph by paragraph.  When it finds a paragraph that
  522. contains a mismatch, it displays point at the beginning of the paragraph
  523. for a few seconds and sets the mark at that spot.  Scanning continues
  524. until the whole buffer has been checked or until you type another key.
  525. Afterward, you can use the mark ring to find the last several paragraphs
  526. that had mismatches (*note Mark Ring::.).
  527.    Note that Emacs commands count square brackets and parentheses in
  528. TeX mode, not just braces.  This is not strictly correct for the
  529. purpose of checking TeX syntax.  However, parentheses and square
  530. brackets are likely to be used in text as matching delimiters and it is
  531. useful for the various motion commands and automatic match display to
  532. work with them.
  533. File: emacs,  Node: LaTeX Editing,  Next: TeX Print,  Prev: TeX Editing,  Up: TeX Mode
  534. LaTeX Editing Commands
  535. ----------------------
  536.    LaTeX mode, and its variant, SliTeX mode, provide a few extra
  537. features not applicable to plain TeX.
  538. `C-c C-o'
  539.      Insert `\begin' and `\end' for LaTeX block and position point on a
  540.      line between them. (`tex-latex-block').
  541. `C-c C-e'
  542.      Close the last unended block for LaTeX (`tex-close-latex-block').
  543.    In LaTeX input, `\begin' and `\end' commands are used to group
  544. blocks of text.  To insert a `\begin' and a matching `\end' (on a new
  545. line following the `\begin'), use `C-c C-o' (`tex-latex-block').  A
  546. blank line is inserted between the two, and point is left there.  You
  547. can use completion when you enter the block type; to specify additional
  548. block type names beyond the standard list, set the variable
  549. `latex-block-names'.  For example, here's how to add `theorem',
  550. `corollary', and `proof':
  551.      (setq latex-block-names '("theorem" "corollary" "proof"))
  552.    In LaTeX input, `\begin' and `\end' commands must balance.  You can
  553. use `C-c C-e' (`tex-close-latex-block') to insert automatically a
  554. matching `\end' to match the last unmatched `\begin'.  It indents the
  555. `\end' to match the corresponding `\begin'.  It inserts a newline after
  556. `\end' if point is at the beginning of a line.
  557. File: emacs,  Node: TeX Print,  Next: TeX Distrib,  Prev: LaTeX Editing,  Up: TeX Mode
  558. TeX Printing Commands
  559. ---------------------
  560.    You can invoke TeX as an inferior of Emacs on either the entire
  561. contents of the buffer or just a region at a time.  Running TeX in this
  562. way on just one chapter is a good way to see what your changes look
  563. like without taking the time to format the entire file.
  564. `C-c C-r'
  565.      Invoke TeX on the current region, together with the buffer's header
  566.      (`tex-region').
  567. `C-c C-b'
  568.      Invoke TeX on the entire current buffer (`tex-buffer').
  569. `C-c TAB'
  570.      Invoke BibTeX on the current file (`tex-bibtex-file').
  571. `C-c C-f'
  572.      Invoke TeX on the current file (`tex-file').
  573. `C-c C-l'
  574.      Recenter the window showing output from the inferior TeX so that
  575.      the last line can be seen (`tex-recenter-output-buffer').
  576. `C-c C-k'
  577.      Kill the TeX subprocess (`tex-kill-job').
  578. `C-c C-p'
  579.      Print the output from the last `C-c C-r', `C-c C-b', or `C-c C-f'
  580.      command (`tex-print').
  581. `C-c C-v'
  582.      Preview the output from the last `C-c C-r', `C-c C-b', or `C-c
  583.      C-f' command (`tex-view').
  584. `C-c C-q'
  585.      Show the printer queue (`tex-show-print-queue').
  586.    You can pass the current buffer through an inferior TeX by means of
  587. `C-c C-b' (`tex-buffer').  The formatted output appears in a temporary
  588. file; to print it, type `C-c C-p' (`tex-print').  Afterward, you can
  589. use `C-c C-q' (`tex-show-print-queue') to view the progress of your
  590. output towards being printed.  If your terminal has the ability to
  591. display TeX output files, you can preview the output on the terminal
  592. with `C-c C-v' (`tex-view').
  593.    You can specify the directory to use for running TeX by setting the
  594. variable `tex-directory'.  `"."' is the default value.  If your
  595. environment variable `TEXINPUTS' contains relative directory names, or
  596. if your files contains `\input' commands with relative file names, then
  597. `tex-directory' *must* be `"."' or you will get the wrong results.
  598. Otherwise, it is safe to specify some other directory, such as `"/tmp"'.
  599.    If you want to specify which shell commands are used in the inferior
  600. TeX, you can do so by setting the values of the variables
  601. `tex-run-command', `latex-run-command', `slitex-run-command',
  602. `tex-dvi-print-command', `tex-dvi-view-command', and
  603. `tex-show-queue-command'.  You *must* set the value of
  604. `tex-dvi-view-command' for your particular terminal; this variable has
  605. no default value.  The other variables have default values that may (or
  606. may not) be appropriate for your system.
  607.    Normally, the file name given to these commands comes at the end of
  608. the command string; for example, `latex FILENAME'.  In some cases,
  609. however, the file name needs to be embedded in the command; an example
  610. is when you need to provide the file name as an argument to one command
  611. whose output is piped to another.  You can specify where to put the
  612. file name with `*' in the command string.  For example,
  613.      (setq tex-dvi-print-command "dvips -f * | lpr")
  614.    The terminal output from TeX, including any error messages, appears
  615. in a buffer called `*tex-shell*'.  If TeX gets an error, you can switch
  616. to this buffer and feed it input (this works as in Shell mode; *note
  617. Interactive Shell::.).  Without switching to this buffer you can scroll
  618. it so that its last line is visible by typing `C-c C-l'.
  619.    Type `C-c C-k' (`tex-kill-job') to kill the TeX process if you see
  620. that its output is no longer useful.  Using `C-c C-b' or `C-c C-r' also
  621. kills any TeX process still running.
  622.    You can also pass an arbitrary region through an inferior TeX by
  623. typing `C-c C-r' (`tex-region').  This is tricky, however, because most
  624. files of TeX input contain commands at the beginning to set parameters
  625. and define macros, without which no later part of the file will format
  626. correctly.  To solve this problem, `C-c C-r' allows you to designate a
  627. part of the file as containing essential commands; it is included before
  628. the specified region as part of the input to TeX.  The designated part
  629. of the file is called the "header".
  630.    To indicate the bounds of the header in Plain TeX mode, you insert
  631. two special strings in the file.  Insert `%**start of header' before the
  632. header, and `%**end of header' after it.  Each string must appear
  633. entirely on one line, but there may be other text on the line before or
  634. after.  The lines containing the two strings are included in the header.
  635. If `%**start of header' does not appear within the first 100 lines of
  636. the buffer, `C-c C-r' assumes that there is no header.
  637.    In LaTeX mode, the header begins with `\documentstyle' and ends with
  638. `\begin{document}'.  These are commands that LaTeX requires you to use
  639. in any case, so nothing special needs to be done to identify the header.
  640.    The commands (`tex-buffer') and (`tex-region') do all of their work
  641. in a temporary directory, and do not have available any of the auxiliary
  642. files needed by TeX for cross-references; these commands are generally
  643. not suitable for running the final copy in which all of the
  644. cross-references need to be correct.  When you want the auxiliary
  645. files, use `C-c C-f' (`tex-file') which runs TeX on the current
  646. buffer's file, in that file's directory.  Before TeX runs, you will be
  647. asked about saving any modified buffers.  Generally, you need to use
  648. (`tex-file') twice to get cross-references correct.
  649.    For LaTeX files, you can use BibTeX to process the auxiliary file
  650. for the current buffer's file.  BibTeX looks up bibliographic citations
  651. in a data base and prepares the cited references for the bibliography
  652. section.  The command `C-c TAB' (`tex-bibtex-file') runs the shell
  653. command (`tex-bibtex-command') to produce a `.bbl' file for the current
  654. buffer's file.  Generally, you need to do `C-c C-f' (`tex-file') once
  655. to generate the `.aux' file, then do `C-c TAB' (`tex-bibtex-file'), and
  656. then repeat `C-c C-f' (`tex-file') twice more to get the
  657. cross-references correct.
  658.    Entering any kind of TeX mode runs the hooks `text-mode-hook' and
  659. `tex-mode-hook'.  Then it runs either `plain-tex-mode-hook' or
  660. `latex-mode-hook', whichever is appropriate.  For SliTeX files, it
  661. calls `slitex-mode-hook'.  Starting the TeX shell runs the hook
  662. `tex-shell-hook'.  *Note Hooks::.
  663. File: emacs,  Node: TeX Distrib,  Prev: TeX Print,  Up: TeX Mode
  664. Unix TeX Distribution
  665. ---------------------
  666.    TeX for Unix systems can be obtained from the University of
  667. Washington for a distribution fee.
  668.    To order a full distribution, specify whether you prefer 1/4 inch
  669. QIC-24 or 4mm DAT tape (9-track reel-to-reel is no longer available)
  670. and send $210.00 for a (tar or cpio) cartridge, payable to the
  671. University of Washington to:
  672.      Pierre MacKay
  673.      Department of Classics
  674.      Denny Hall, Mail Stop DH-10
  675.      University of Washington
  676.      Seattle, Washington 98195
  677. Purchase orders are acceptable, but there is an extra charge of $10.00,
  678. to pay for processing charges.
  679. For overseas orders please add $20.00 to the base cost for shipment via
  680. air parcel post, or $30.00 for shipment via courier.
  681.    The normal distribution is a tar tape, blocked 20, 1600 bpi, on an
  682. industry standard 2400 foot half-inch reel.  The physical format for the
  683. 1/4 inch streamer cartridges is QIC-24.  System V tapes can be written
  684. in cpio format, blocked 5120 bytes, with ASCII headers.
  685. File: emacs,  Node: Nroff Mode,  Prev: TeX Mode,  Up: Text
  686. Nroff Mode
  687. ==========
  688.    Nroff mode is a mode like Text mode but modified to handle nroff
  689. commands present in the text.  Invoke `M-x nroff-mode' to enter this
  690. mode.  It differs from Text mode in only a few ways.  All nroff command
  691. lines are considered paragraph separators, so that filling will never
  692. garble the nroff commands.  Pages are separated by `.bp' commands.
  693. Comments start with backslash-doublequote.  Also, three special
  694. commands are provided that are not in Text mode:
  695. `M-n'
  696.      Move to the beginning of the next line that isn't an nroff command
  697.      (`forward-text-line').  An argument is a repeat count.
  698. `M-p'
  699.      Like `M-n' but move up (`backward-text-line').
  700. `M-?'
  701.      Prints in the echo area the number of text lines (lines that are
  702.      not nroff commands) in the region (`count-text-lines').
  703.    The other feature of Nroff mode is that you can turn on Electric
  704. Nroff mode.  This is a minor mode that you can turn on or off with `M-x
  705. electric-nroff-mode' (*note Minor Modes::.).  When the mode is on, each
  706. time you use RET to end a line that contains an nroff command that
  707. opens a kind of grouping, the matching nroff command to close that
  708. grouping is automatically inserted on the following line.  For example,
  709. if you are at the beginning of a line and type `. ( b RET', this
  710. inserts the matching command `.)b' on a new line following point.
  711.    If you use Outline minor mode with Nroff mode (*note Outline
  712. Mode::.), heading lines are lines of the form `.H' followed by a number
  713. (the header level).
  714.    Entering Nroff mode runs the hook `text-mode-hook', followed by the
  715. hook `nroff-mode-hook' (*note Hooks::.).
  716. File: emacs,  Node: Programs,  Next: Building,  Prev: Text,  Up: Top
  717. Editing Programs
  718. ****************
  719.    Emacs has many commands designed to understand the syntax of
  720. programming languages such as Lisp and C.  These commands can
  721.    * Move over or kill balanced expressions or "sexps" (*note Lists::.).
  722.    * Move over or mark top-level expressions--"defuns", in Lisp;
  723.      functions, in C (*note Defuns::.).
  724.    * Show how parentheses balance (*note Matching::.).
  725.    * Insert, kill or align comments (*note Comments::.).
  726.    * Follow the usual indentation conventions of the language (*note
  727.      Program Indent::.).
  728.    The commands for words, sentences and paragraphs are very useful in
  729. editing code even though their canonical application is for editing
  730. human language text.  Most symbols contain words (*note Words::.);
  731. sentences can be found in strings and comments (*note Sentences::.).
  732. Paragraphs per se don't exist in code, but the paragraph commands are
  733. useful anyway, because programming language major modes define
  734. paragraphs to begin and end at blank lines (*note Paragraphs::.).
  735. Judicious use of blank lines to make the program clearer will also
  736. provide useful chunks of text for the paragraph commands to work on.
  737.    The selective display feature is useful for looking at the overall
  738. structure of a function (*note Selective Display::.).  This feature
  739. causes only the lines that are indented less than a specified amount to
  740. appear on the screen.
  741. * Menu:
  742. * Program Modes::     Major modes for editing programs.
  743. * Lists::             Expressions with balanced parentheses.
  744. * List Commands::     The commands for working with list and sexps.
  745. * Defuns::            Each program is made up of separate functions.
  746.                         There are editing commands to operate on them.
  747. * Program Indent::    Adjusting indentation to show the nesting.
  748. * Matching::          Insertion of a close-delimiter flashes matching open.
  749. * Comments::          Inserting, killing, and aligning comments.
  750. * Balanced Editing::  Inserting two matching parentheses at once, etc.
  751. * Symbol Completion:: Completion on symbol names of your program or language.
  752. * Documentation::     Getting documentation of functions you plan to call.
  753. * Change Log::        Maintaining a change history for your program.
  754. * Tags::              Go direct to any function in your program in one
  755.                         command.  Tags remembers which file it is in.
  756. * Emerge::          A convenient way of merging two versions of a program.
  757. * C Mode::          Special commands of C mode (and C++ mode).
  758. * Fortran::          Fortran mode and its special features.
  759. * Asm Mode::          Asm mode and its special features.
  760. File: emacs,  Node: Program Modes,  Next: Lists,  Up: Programs
  761. Major Modes for Programming Languages
  762. =====================================
  763.    Emacs also has major modes for the programming languages Lisp, Scheme
  764. (a variant of Lisp), Awk, C, C++, Fortran, Icon, Pascal, Perl and Tcl.
  765. There is also a major mode for makefiles, called Makefile mode.
  766.    Ideally, a major mode should be implemented for each programming
  767. language that you might want to edit with Emacs; but often the mode for
  768. one language can serve for other syntactically similar languages.  The
  769. language modes that exist are those that someone decided to take the
  770. trouble to write.
  771.    There are several forms of Lisp mode, which differ in the way they
  772. interface to Lisp execution.  *Note Executing Lisp::.
  773.    Each of the programming language modes defines the TAB key to run an
  774. indentation function that knows the indentation conventions of that
  775. language and updates the current line's indentation accordingly.  For
  776. example, in C mode TAB is bound to `c-indent-line'.  LFD is normally
  777. defined to do RET followed by TAB; thus, it too indents in a
  778. mode-specific fashion.
  779.    In most programming languages, indentation is likely to vary from
  780. line to line.  So the major modes for those languages rebind DEL to
  781. treat a tab as if it were the equivalent number of spaces (using the
  782. command `backward-delete-char-untabify').  This makes it possible to
  783. rub out indentation one column at a time without worrying whether it is
  784. made up of spaces or tabs.  Use `C-b C-d' to delete a tab character
  785. before point, in these modes.
  786.    Programming language modes define paragraphs to be separated only by
  787. blank lines, so that the paragraph commands remain useful.  Auto Fill
  788. mode, if enabled in a programming language major mode, indents the new
  789. lines which it creates.
  790.    Turning on a major mode runs a normal hook called the "mode hook",
  791. which is the value of a Lisp variable.  Each major mode has a mode hook,
  792. and the hook's name is always made from the mode command's name by
  793. adding `-hook'.  For example, turning on C mode runs the hook
  794. `c-mode-hook', while turning on Lisp mode runs the hook
  795. `lisp-mode-hook'.  *Note Hooks::.
  796. File: emacs,  Node: Lists,  Next: List Commands,  Prev: Program Modes,  Up: Programs
  797. Lists and Sexps
  798. ===============
  799.    By convention, Emacs keys for dealing with balanced expressions are
  800. usually Control-Meta characters.  They tend to be analogous in function
  801. to their Control and Meta equivalents.  These commands are usually
  802. thought of as pertaining to expressions in programming languages, but
  803. can be useful with any language in which some sort of parentheses exist
  804. (including human languages).
  805.    These commands fall into two classes.  Some deal only with "lists"
  806. (parenthetical groupings).  They see nothing except parentheses,
  807. brackets, braces (whichever ones must balance in the language you are
  808. working with), and escape characters that might be used to quote those.
  809.    The other commands deal with expressions or "sexps".  The word `sexp'
  810. is derived from "s-expression", the ancient term for an expression in
  811. Lisp.  But in Emacs, the notion of `sexp' is not limited to Lisp.  It
  812. refers to an expression in whatever language your program is written in.
  813. Each programming language has its own major mode, which customizes the
  814. syntax tables so that expressions in that language count as sexps.
  815.    Sexps typically include symbols, numbers, and string constants, as
  816. well as anything contained in parentheses, brackets or braces.
  817.    In languages that use prefix and infix operators, such as C, it is
  818. not possible for all expressions to be sexps.  For example, C mode does
  819. not recognize `foo + bar' as a sexp, even though it *is* a C expression;
  820. it recognizes `foo' as one sexp and `bar' as another, with the `+' as
  821. punctuation between them.  This is a fundamental ambiguity: both `foo +
  822. bar' and `foo' are legitimate choices for the sexp to move over if
  823. point is at the `f'.  Note that `(foo + bar)' is a single sexp in C
  824. mode.
  825.    Some languages have obscure forms of expression syntax that nobody
  826. has bothered to make Emacs understand properly.
  827. File: emacs,  Node: List Commands,  Next: Defuns,  Prev: Lists,  Up: Programs
  828. List And Sexp Commands
  829. ======================
  830. `C-M-f'
  831.      Move forward over a sexp (`forward-sexp').
  832. `C-M-b'
  833.      Move backward over a sexp (`backward-sexp').
  834. `C-M-k'
  835.      Kill sexp forward (`kill-sexp').
  836. `C-M-DEL'
  837.      Kill sexp backward (`backward-kill-sexp').
  838. `C-M-u'
  839.      Move up and backward in list structure (`backward-up-list').
  840. `C-M-d'
  841.      Move down and forward in list structure (`down-list').
  842. `C-M-n'
  843.      Move forward over a list (`forward-list').
  844. `C-M-p'
  845.      Move backward over a list (`backward-list').
  846. `C-M-t'
  847.      Transpose expressions (`transpose-sexps').
  848. `C-M-@'
  849.      Put mark after following expression (`mark-sexp').
  850.    To move forward over a sexp, use `C-M-f' (`forward-sexp').  If the
  851. first significant character after point is an opening delimiter (`(' in
  852. Lisp; `(', `[' or `{' in C), `C-M-f' moves past the matching closing
  853. delimiter.  If the character begins a symbol, string, or number,
  854. `C-M-f' moves over that.
  855.    The command `C-M-b' (`backward-sexp') moves backward over a sexp.
  856. The detailed rules are like those above for `C-M-f', but with
  857. directions reversed.  If there are any prefix characters (single-quote,
  858. backquote and comma, in Lisp) preceding the sexp, `C-M-b' moves back
  859. over them as well.  The sexp commands move across comments as if they
  860. were whitespace in most modes.
  861.    `C-M-f' or `C-M-b' with an argument repeats that operation the
  862. specified number of times; with a negative argument, it moves in the
  863. opposite direction.
  864.    Killing a sexp at a time can be done with `C-M-k' (`kill-sexp') or
  865. `C-M-DEL' (`backward-kill-sexp').  `C-M-k' kills the characters that
  866. `C-M-f' would move over, and `C-M-DEL' kills the characters that
  867. `C-M-b' would move over.
  868.    The "list commands" move over lists like the sexp commands but skip
  869. blithely over any number of other kinds of sexps (symbols, strings,
  870. etc).  They are `C-M-n' (`forward-list') and `C-M-p' (`backward-list').
  871. The main reason they are useful is that they usually ignore comments
  872. (since the comments usually do not contain any lists).
  873.    `C-M-n' and `C-M-p' stay at the same level in parentheses, when
  874. that's possible.  To move *up* one (or N) levels, use `C-M-u'
  875. (`backward-up-list').  `C-M-u' moves backward up past one unmatched
  876. opening delimiter.  A positive argument serves as a repeat count; a
  877. negative argument reverses direction of motion and also requests
  878. repetition, so it moves forward and up one or more levels.
  879.    To move *down* in list structure, use `C-M-d' (`down-list').  In
  880. Lisp mode, where `(' is the only opening delimiter, this is nearly the
  881. same as searching for a `('.  An argument specifies the number of levels
  882. of parentheses to go down.
  883.    A somewhat random-sounding command which is nevertheless handy is
  884. `C-M-t' (`transpose-sexps'), which drags the previous sexp across the
  885. next one.  An argument serves as a repeat count, and a negative
  886. argument drags backwards (thus canceling out the effect of `C-M-t' with
  887. a positive argument).  An argument of zero, rather than doing nothing,
  888. transposes the sexps ending after point and the mark.
  889.    To set the region around the next sexp in the buffer, use `C-M-@'
  890. (`mark-sexp'), which sets mark at the same place that `C-M-f' would
  891. move to.  `C-M-@' takes arguments like `C-M-f'.  In particular, a
  892. negative argument is useful for putting the mark at the beginning of
  893. the previous sexp.
  894.    The list and sexp commands' understanding of syntax is completely
  895. controlled by the syntax table.  Any character can, for example, be
  896. declared to be an opening delimiter and act like an open parenthesis.
  897. *Note Syntax::.
  898.